package com.sky.config;

import com.sky.properties.MinioOssProperties;
import com.sky.utils.MinioOssUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 唐佳辉
 */
@Configuration
@Slf4j
public class MinioConfig {


    @Bean
    //当没有这个bean的时候创建
    @ConditionalOnMissingBean
    public MinioOssUtil minioOssUtil(MinioOssProperties minioOssProperties) {
        log.info("开始创建Minio文件上传对象");
        return new MinioOssUtil(minioOssProperties);

    }

}
